<style scoped>
  .weui-form-preview__hd label, .weui-form-preview__hd em {
    font-size: .9em !important;
  }
  .weui-loadmore_line .weui-loadmore__tips {
    background-color: #eee;
  }
  .weui-cells {
    margin-top: 0;
  }
  .weui-cells_form {
    background: #fbfbfb;
  }
  .weui-cell {
    background: #fff;
  }
  .weui-cells__title {
    text-align: left;
  }
  .oitem {
    padding: 3px;
  }
  .hide {
    display: none;
  }
  #acts {
    font-size: 0;
  }
  #acts span {
    font-size: 14px;
  }
  .halfbtn {
    display: inline-block;
    width: 49%;
  }
  .weui-label {
    text-align: left;
  }
  .weui_cell {
    padding: 10px 15px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    background: #fff;
  }
  .weui-cell_select {
    padding: 0 15px;
  }


  .weui-panel {
    background: #eee;
  }

  .rj-cont-tit {
    margin: 0;
    border-radius: 0;
  }

  .weui-panel {
    margin-top: 0;
    text-align: left;
  }

  .hd .weui-grid.js_grid {
    font-weight: 600;
  }

  .weui-grid.js_grid {
    width: 25%;
    padding: 10px 1px;
  }

  /*.weui-grid.fir {*/
  /*  width: 20%;*/
  /*}*/
  /*.weui-grid.sec {*/
  /*  width: 15%;*/
  /*}*/
  /*.weui-grid.thr {*/
  /*  width: 20%;*/
  /*}*/
  /*.weui-grid.fou {*/
  /*  width: 15%;*/
  /*}*/
  /*.weui-grid.fiv {*/
  /*  width: 15%;*/
  /*}*/
  .weui-grid__label {
    text-overflow: initial;
  }
  .section {
    margin: 5px;
    border-radius: 5px;
  }


  .weui_uploader_input_wrp {
    float: left;
    position: relative;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 77px;
    height: 77px;
    border: 1px solid #D9D9D9;
  }

  .weui_uploader_hd {
    padding-top: 0;
    padding-right: 0;
    padding-left: 0;
  }

  .weui_uploader_files {
    list-style: none;
  }

  .weui_uploader_input_wrp:before {
    width: 2px;
    height: 39.5px;
  }

  .weui_uploader_input_wrp:before, .weui_uploader_input_wrp:after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background-color: #D9D9D9;
  }

  .weui_uploader_input {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  .weui_uploader_input_wrp:after {
    width: 39.5px;
    height: 2px;
  }

  .weui_uploader_bd {
    overflow: hidden;
  }

  .weui_cell {
    padding: 10px 15px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .outstore >>> .weui-uploader_files {
    list-style: none;
    overflow-y: hidden;
  }

  .outstore >>> .weui-uploader_file {
    float: left;
    margin-right: 9px;
    margin-bottom: 9px;
    width: 79px;
    background: no-repeat 50%;
    background-size: cover;
  }

  .weui-cell.fir {
    border-top: 0;
  }

  .help {
    text-align: right;
    padding: 5px;
    font-size: 12px;
    color: #bbb;
  }

  .weui_uploader_input_wrp.inrow {
    width: 30px;
    height: 30px;
    margin: 0;
  }

  .weui_uploader_input_wrp:before {
    height: 19.5px;
  }

  .weui_uploader_input_wrp:after {
    width: 19.5px;
  }

  .weui-uploader_file.inrow {
    margin: 0;
    width: 40px;
  }

  li.weui-uploader_file {
    display: inline-block;
    padding: 3px 5px;
  }

  ul#images {
    text-align: right;
  }
  .weui-panel__bd {
    width: auto !important;
    padding: 10px 15px;
    text-align: left;
  }
  .rj-cell {
    font-size: 0.9em;
    display: inline-block;
    margin-right: 15px;
  }
</style>
<template>
  <div class="examine" style="background: #eee;">
    <div class="rj-wrap" style="background: #fff;">
      {{title}}
      <a href="javascript:;" @click="$router.back(-1)" style="position: absolute; left: 10px; top: 8px">
        <img src="@/assets/back.png" style="width: 20px" />
      </a>
    </div>
    <!--    主表信息-->
    <div class="weui-form-preview section" style="background: #fff;">
      <div class="weui-form-preview__hd">
        <label class="weui-form-preview__label">编号</label>
        <em class="weui-form-preview__value">{{baseInfo.code}}</em>
      </div>
      <div class="weui-form-preview__bd">
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">公司名</label>
          <span class="weui-form-preview__value">{{baseInfo.orgname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">部门</label>
          <span class="weui-form-preview__value">{{baseInfo.departname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">调出库房</label>
          <span class="weui-form-preview__value">{{baseInfo.fromsrname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">调入库房</label>
          <span class="weui-form-preview__value">{{baseInfo.tosrname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">入库公司</label>
          <span class="weui-form-preview__value">{{baseInfo.toorgname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">调拨重量</label>
          <span class="weui-form-preview__value">{{attachUnit(baseInfo.shiftweight, '吨')}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">状态</label>
          <span class="weui-form-preview__value">{{baseInfo.statusname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">备注</label>
          <span class="weui-form-preview__value">{{baseInfo.remark}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">操作人</label>
          <span class="weui-form-preview__value">{{baseInfo.applyname}}</span>
        </div>
        <div class="weui-form-preview__item">
          <label class="weui-form-preview__label">创建时间</label>
          <span class="weui-form-preview__value">{{baseInfo.createtime}}</span>
        </div>
        <div class="weui-form-preview__item" v-if="baseInfo.files && baseInfo.files.length > 0">
          <label class="weui-form-preview__label">附件</label>
          <a v-for="(item, index) in baseInfo.files" :href="item.url">
            <span class="weui-form-preview__value">{{item.imagename}}</span>
          </a>
        </div>
      </div>
    </div>
<!--    <div class="weui-panel__hd" style="text-align: left;">货运信息</div>-->
<!--    <div class="weui-panel__bd" style="background: #fff;">-->
<!--      <div class="rj-cell max">-->
<!--        <label>货运要求：</label>-->
<!--        <span>{{baseInfo.freightclaim}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>物流公司：</label>-->
<!--        <span>{{baseInfo.wlcompany}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>司机姓名：</label>-->
<!--        <span>{{baseInfo.drivername}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>司机电话：</label>-->
<!--        <span>{{baseInfo.driverphone}}</span>-->
<!--      </div> <div class="rj-cell max">-->
<!--      <label>车牌号：</label>-->
<!--      <span>{{baseInfo.carcode}}</span>-->
<!--    </div>-->
<!--    </div>-->
<!--    <div class="weui-panel__hd" style="text-align: left;">发货信息</div>-->
<!--    <div class="weui-panel__bd" style="background: #fff;">-->
<!--      <div class="rj-cell max">-->
<!--        <label>联系人：</label>-->
<!--        <span>{{baseInfo.delicontact}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>联系人电话：</label>-->
<!--        <span>{{baseInfo.delicontactno}}</span>-->
<!--      </div>-->
<!--      <br/>-->
<!--      <div class="rj-cell max">-->
<!--        <label>发货时间：</label>-->
<!--        <span>{{baseInfo.loadtime}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>发货总重量：</label>-->
<!--        <span>{{baseInfo.loadweight}}</span>-->
<!--      </div>-->
<!--      <br/>-->
<!--      <div class="rj-cell max">-->
<!--        <label>省：</label>-->
<!--        <span>{{baseInfo.deliprovince}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>市：</label>-->
<!--        <span>{{baseInfo.delicity}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max" >-->
<!--        <label>区：</label>-->
<!--        <span>{{baseInfo.delidistrict}}</span>-->
<!--      </div>-->

<!--      <div class="rj-cell max" >-->
<!--        <label>详细地址：</label>-->
<!--        <span>{{baseInfo.deliaddress}}</span>-->
<!--      </div>-->
<!--    </div>-->
<!--    <div class="weui-panel__hd" style="text-align: left;">到货信息</div>-->
<!--    <div class="weui-panel__bd" style="background: #fff;">-->
<!--      <div class="rj-cell max">-->
<!--        <label>到货时间：</label>-->
<!--        <span>{{baseInfo.unloadtime}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>到货总重量：</label>-->
<!--        <span>{{baseInfo.unloadweight}}</span>-->
<!--      </div>-->
<!--      <br/>-->
<!--      <div class="rj-cell max">-->
<!--        <label>省：</label>-->
<!--        <span>{{baseInfo.arriprovince}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>市：</label>-->
<!--        <span>{{baseInfo.arricity}}</span>-->
<!--      </div>-->
<!--      <div class="rj-cell max">-->
<!--        <label>区：</label>-->
<!--        <span>{{baseInfo.arridistrict}}</span>-->
<!--      </div>-->

<!--      <div class="rj-cell max">-->
<!--        <label>详细地址：</label>-->
<!--        <span>{{baseInfo.arriaddress}}</span>-->
<!--      </div>-->
<!--    </div>-->
    <!--    明细信息-->
    <div class="weui-panel__hd" style="text-align: left;">货品明细</div>
    <div class="section" v-for="(product, index) in baseInfo.items">
      <input type="hidden" :name="'items[' + index + '].applyitemid'" :value="product.guid" />
      <input type="hidden" :name="'items[' + index + '].productguid'" :value="product.productguid" />
      <input type="hidden" :name="'items[' + index + '].spguid'" :value="product.spguid" />
      <input type="hidden" :name="'items[' + index + '].stockunitid'" :value="product.stockunitid" />
      <input type="hidden" :name="'items[' + index + '].stockunit'" :value="product.stockunit" />
      <div class="weui-cell fir">
        <div class="weui-cell__hd"><label class="weui-label">货品类型</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" name="" readonly="true" :value="product.typename">
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">产品</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" name="" readonly="true" :value="product.product">
        </div>
      </div>
      <!--          <div class="weui-cell" v-if="product.type != 1">-->
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">规格</label></div>
        <div class="weui-cell__bd">
          <input class="weui-input" type="text" name="" readonly="true" :value="product.spname">
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">库间</label></div>
        <div class="weui-cell__bd">
          <input type="hidden" ref="fromshname" name="toshname">
          <select class="weui-select house" v-model="baseInfo.items[index].shrguid">
            <option value="" disabled>请选择</option>
            <option v-for="(item, i) in autoHouses(index)" :key="item.guid" :value="item.guid">{{item.name}}</option>
          </select>
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">数量</label></div>
        <div class="weui-cell__bd">
          <input v-if="product.isWeiOrNum == 1" class="weui-input weight inlinput1" type="number" v-model="baseInfo.items[index].weight" :name="'items[' + index + '].weight'" placeholder="请输入数量">
          <input v-else class="weui-input weight inlinput1" readonly type="number" v-model="baseInfo.items[index].weight" :name="'items[' + index + '].weight'" placeholder="请输入数量">
          <input class="weui-input inlinput2" type="text" readonly :value="product.stockunit">
        </div>
      </div>
    </div>
    <!--    质检信息-->
    <div v-if="qaform.qacode != '' && qaform.qacode != null">
      <div class="weui-panel__hd" style="text-align: left;">质检信息</div>
      <div class="weui-panel__bd section" style="background: #fff;">
        <div  >
          <div class="rj-cell max">
            <label><span style="font-size: 14px;padding: 0;">质检单编号：</span></label>
            <span>{{qaform.qacode}}</span>

          </div>
        </div>
        <div class="rj-cell max">
          <label>抽检数量：</label>
          <span>{{qaform.chkpknum}} 包</span>
          <span> {{qaform.chkwght}} Kg</span>

          <label>合格重量：</label>
          <span> {{qaform.okweight}} Kg</span>
        </div>
        <div class="rj-cell max">
          <label>不合格重量：</label>
          <span> {{qaform.notokweight}} Kg</span>
          <label>不合格率：</label>
          <span> {{qaform.unqualifiedchkrate}}%</span>
        </div>
        <div class="rj-cell max">
          <label>土杂重量：</label>
          <span> {{qaform.soilchkweight}} Kg</span>
          <label>土杂率：</label>
          <span> {{qaform.soilchkrate}}%</span>
        </div>
        <br>
        <div class="rj-cell max">
          <label>合格率：</label>
          <span> {{Number((100-qaform.deductrate)).toFixed(2)}} %</span>
        </div>

        <div class="rj-cell max">
          <label>质检人：</label>
          <span>{{qaform.operatorname}}</span>
          <label>质检时间：</label>
          <span>{{qaform.createdate}}</span>
        </div>
        <div class="weui-media-box weui-media-box_text uploaderFiles" v-if="qaFormImg != undefined && qaFormImg.length > 0">
          <p class="exp" style="font-size: 12px;color: #999;padding: 5px 0;">质检单照片</p>
          <div class="exp uploaderFiles" style="display: inline-block;">
            <img class="attachimg" style="padding-right: 5px;"  v-for="(image, index) in qaFormImg" :key="image.guid"  alt="" onerror="javascript:this.src='../../../../static/image/default.png';this.onerror = null" :src="image.url + '-suolue.png'" :data-img="image.url + '.png'" />
          </div>
        </div>
      </div>
    </div>
    <!--    出库单信息-->
    <div v-if="whoutform != null && whoutform != ''">
      <div class="weui-panel__hd" style="text-align: left;">出库单信息</div>
      <div class="weui-panel__bd section" style="background: #fff;">
        <div v-for="(outObj, index) in whoutform">
          <div class="rj-cell max">
            <label>出库单编号：</label>
            <span>{{outObj.whoutcode}}</span>
          </div>
          <div class="rj-cell max">
            <label>库房：</label>
            <span>{{outObj.storeroom}} </span>
            <!--              <label>重量：</label>-->
            <!--              <span> {{outObj.weight}} 吨</span>-->
          </div>
          <div class="rj-cell max">
            <label>操作人：</label>
            <span>{{outObj.operator}}</span>
            <label>出库时间：</label>
            <span>{{outObj.createtime}}</span>
          </div>
          <p style="color: #999;font-size: 12px;"> 出库单明细 </p>
          <div v-for="(product, index) in outObj.items" style="border-top: 1px solid #ccc;" >
            <div style="background: #eee;padding: 3px;">
              <div class="rj-cell max"  >
                <label> 库间：</label>
                <span>{{product.house}} </span>
              </div>
              <div class="rj-cell max"  >
                <label> 产品：</label>
                <span>{{product.product}} </span>
                <span>{{product.spename}} </span>
                <span>{{product.weight}} {{product.stockunit}}</span>
              </div>
            </div>
          </div>
          <div class="weui-media-box weui-media-box_text uploaderFiles" v-if="outObj.imgs != undefined && outObj.imgs.length > 0">
            <p class="exp" style="font-size: 12px;color: #999;padding: 5px 0;">出库单单据</p>
            <div class="exp uploaderFiles" style="display: inline-block;">
              <img class="attachimg" style="padding-right: 5px;"  v-for="(image, index) in outObj.imgs " :key="image.guid"  alt="" onerror="javascript:this.src='../../../../static/image/default.png';this.onerror = null" :src="image.url + '-suolue.png'" :data-img="image.url + '.png'" />
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--    入库单信息-->
    <div v-if="whinform != null && whinform != ''">
      <div class="weui-panel__hd" style="text-align: left;">入库单信息</div>
      <div class="weui-panel__bd section" style="background: #fff;">
        <div v-for="(outObj, index) in whinform">
          <!--          <div style="border-top: 0px solid #eee;">-->
          <div class="rj-cell max">
            <label>入库单编号：</label>
            <span>{{outObj.formno}}</span>
          </div>
          <div class="rj-cell max">
            <label>库房：</label>
            <span>{{outObj.strname}} </span>
          </div>

          <div class="rj-cell max">
            <label>操作人：</label>
            <span>{{outObj.operator}}</span>

            <label>出库时间：</label>
            <span>{{outObj.createdate}}</span>
          </div>
          <p style="color: #999;font-size: 12px;"> 入库单明细 </p>
          <div v-for="(product, index) in outObj.items" style="border-top: 1px solid #ccc;" >
            <div style="background: #eee;padding: 3px;">
              <div class="rj-cell max"  >
                <label> 库间：</label>
                <span>{{product.house}} </span>
              </div>
              <div class="rj-cell max"  >
                <label> 产品：</label>
                <span>{{product.product}} </span>
                <span>{{product.spename}} </span>
                <span>{{product.weight}} {{product.stockunit}}</span>
              </div>
            </div>
          </div>
          <div class="weui-media-box weui-media-box_text uploaderFiles" v-if="outObj.images != undefined && outObj.images.length > 0">
            <p class="exp" style="font-size: 12px;color: #999;padding: 5px 0;">入库单单据</p>
            <div class="exp uploaderFiles" style="display: inline-block;">
              <img class="attachimg" style="padding-right: 5px;"  v-for="(image, index) in outObj.images " :key="image.guid"  alt="" onerror="javascript:this.src='../../../../static/image/default.png';this.onerror = null" :src="image.url + '-suolue.png'" :data-img="image.url + '.png'" />
            </div>
          </div>
          <!--          </div>-->
        </div>
      </div>
    </div>
    <!--    动态数据-->
    <p style="height: 5px;"></p>
      <div class="weui-cells weui-cells_form section">
      <form action="" method="post" id="formid">
        <div class="weui-cell fir">
          <div class="weui-cell__hd"><label class="weui-label">附件上传</label></div>
          <div class="weui-cell__ft">
            <div class="weui_uploader_bd">
              <ul class="weui_uploader_files"></ul>
              <div class="weui_uploader_input_wrp inrow">
                <UploadFile3 class="weui_uploader_input" v-on:pushfile="setFile"></UploadFile3>
              </div>
            </div>
          </div>
          <ul class="weui-uploader_files" id="images">
            <li class="weui-uploader_file" v-for="(fil, index) in filenames" @click=delFile(fil,fileids[index])>
              {{fil}}
            </li>
          </ul>
        </div>
        <div class="weui-cell">
          <div class="weui-cell__bd">
            <textarea class="weui-textarea opinion" id="opinion" v-model="opinion" name="opinion" placeholder="请输入意见内容" rows="2"></textarea>
          </div>
        </div>
      </form>
    </div>
    <div id="bmlogs">
      <SalesOperationLogs7 :nodeid="nodeid" :orderid="id" :srguid="baseInfo.srguid" :departid="baseInfo.departid" :flowid="flowid"></SalesOperationLogs7>
    </div>
      <ApproveBom v-if="isReady" type="transIn" :flowid="flowid" :nodeid="nodeid" :id="id" :srguid="baseInfo.srguid" :departid="baseInfo.departid" :model="baseInfo" :opinion="opinion" :fileids="fileids" :refuseflag="refuseflag" :annex="annex" passUrl="/prod-api/bill/transferapply/transferWhin" refuseUrl="/prod-api//bill/transferapply/refuse" navgateUrl="/transferapply2/TransApplyList" ></ApproveBom>
  </div>
</template>

<script>
  import wx from 'weixin-js-sdk';
  import SalesOperationLogs7 from '@/components/common/SalesOperationLogs7'
  import ApproveBom from '@/components/common/ApproveBom'
  import UploadFile3 from "../common/UploadFile3";

  export default {
  name: 'TransferIn28',
  data () {
    return {
      flowid: 28,
      opinion: '',
      openid: localStorage.openid,
      id: '',
      title: '',
      nodeid: '',
      annex: '',
      baseInfo: {},
      baseItems: '',
      wxParams: {},
      images: {
        serverId: [],
        srcStr: [],
      },
      refuseflag: '',
      refuseNodes: [],
      orderfiles: [],
      isReady: false,
      filenames: [],
      fileids: [],
      qaform:{},
      qaFormImg:[],
      titleName:"",
      whoutform:[],
      whinform:[],
      houses: [],
    }
  },
    components: {
      SalesOperationLogs7,
      ApproveBom,
      UploadFile3
    },
  async mounted () {
    //提交操作定位到页面底部
    //$('#bmlogs').css('margin-bottom', this.$refs.actHtml.offsetHeight)

    //$('#opinion').focus();
    this.id = this.$route.query.id;
    this.nodeid = this.$route.query.nodeid;
    this.annex = this.$route.query.annex;
    this.title = this.$route.query.title;
    this.refuseflag = this.$route.query.refuseflag;
    if (this.$route.query.status) {
      this.status = this.$route.query.status;
    }

    await this.getBaseInfo(this.id);
    this.getSysParam();
  },
  methods: {
    getSysParam: function() {
      this.axios({
        method: 'get',
        url: '/prod-api/system/config/configKey/transfer_whin_weight_param',
      }).then((response) => {
        if (response.data.code == 200) {
          this.baseInfo.weightx = parseFloat(response.data.msg);
        } else if (response.data.msg) {
          this.toastText(response.data.msg);
        }
      })
    },
    getWei: function(val, wei, index) {
      if (val.target.value > wei * (1 + this.tranferParam / 100)) {
        this.toastText('出库重量不能大于: 订单重量 * ' + (100+this.tranferParam) + '%');
        this.$refs['weight' + index][0].value = '';
      }
    },
    autoHouses: function(no) {
      return this.houses['house' + no];
    },
    delFile: function (name, id) {
      let that = this;
      $.confirm('确定要删除？', function () {
        that.axios({
          method: 'post',
          url: '/prod-api/common/delete',
          params: {id: id}
        })
        that.fileids = that.fileids.filter(item => {
          return item != id;
        })
        that.filenames = that.filenames.filter(item => {
          return item != name;
        })
      })
    },
    setFile: function (file) {
      this.filenames.push(file.name);
      this.fileids.push(file.id);
    },
    packUnit: function(unit, currency) {
      return unit != undefined && unit != '' ? currency == 2 ? '美元/' + unit : '元/' + unit : '';
    },
    checkCore:function() {
      var u = navigator.userAgent;
      //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;//g
      var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);   //ios终端
      if (isIOS) {
        return 'ios';
      } else  {
        return 'android';
      }
    },
    getBaseInfo: async function (id) {
      await this.axios({
        method: 'get',
        url: `/prod-api/bill/transferapply/${id}`,
      }).then(response => {
        if (response.data.code == 200) {
          let data = response.data;
          this.baseInfo = data.apply || {};
          this.baseInfo.items = this.baseInfo.items.map(item => {
            item.shrguid = '';
            item.whoutWei = data.whoutform[0].items.find(product => {
              return product.spguid == item.spguid;
            }).weight;
            if (item.isWeiOrNum != 1) {
              item.weight = item.whoutWei;
            }
            return item;
          });
          this.whoutform = data.whoutform || {};
          this.whinform = data.whinform || {};
          this.qaform = data.qaform || {};
          //获取库间
          let items = this.baseInfo.items;
          if (items.length > 0) {
            for (let i=0; i<items.length; i++) {
              this.getHouses(this.baseInfo.tosrId, items[i].type, i);
            }
          }
        } else if (response != undefined && response.data != undefined && response.data.msg == 'sessionTimeOut') {
          //不不设置提示
        } else {
          this.toastError('系统错误');
        }
        this.isReady = true;
      });
    },
    getHouses: function(roomid, type, index) {
      this.axios({
        method: 'get',
        url: '/prod-api/getStoreHouseRoomByRoomId',
        params: {id: roomid, type: type}
      }).then((response) => {
        if (response.data.code == 200) {
          let data = response.data;
          this.$set(this.houses, 'house' + index, data.data);
          //this['house' + index] = data.houses;
        } else if (response.data.msg) {
          this.toastText(response.data.msg);
        } else {
          this.toastText("获取库间数据失败");
        }

      })
    },


}
}
</script>
